﻿@using VipSoft.CMS.Core.Enum
@using VipSoft.Web.Areas.VipSoft.Controllers
@using VipSoft.WebUtility
@model ArticleDto
@{
    ViewBag.Title = "管理首页";
    Layout = "~/Areas/VipSoft/Views/Shared/_AdminLayout.cshtml";
}
@section Style {

    <link href="/Content/themes/VipSoft/dist/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
}
<div class="widget-box">
    <div class="widget-header widget-header-small">
        <h5 class="widget-title smaller">@ViewBag.SubTitle</h5>

        <div class="widget-toolbar no-border">
            <ul class="nav nav-tabs" id="myTab">
                <li class="active">
                    <a data-toggle="tab" href="#info">基本信息</a>
                </li>

                <li>
                    <a data-toggle="tab" href="#extend">扩展属性</a>
                </li>

                <li>
                    <a data-toggle="tab" href="#seo">SEO选项</a>
                </li>
                <li>
                    <a href="@Url.Action("List", new { cid = @Request.RequestContext.RouteData.Values["cid"], mid = @Request.RequestContext.RouteData.Values["mid"] })"><i class="fa fa-reply" title="返回"></i></a>
                </li>
            </ul>
        </div>
    </div>

    <div class="widget-body">
        <div class="widget-main padding-6">
            <form id="frmArticle" method="post" class="form-horizontal">
                <div class="tab-content">
                    <div id="info" class="tab-pane in active">
                        @if (Model.IsShowElement(ArticleElement.CategoryId))
                        {
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right">@Html.LabelFor(model => model.Article.CategoryId)</label>
                                <div class="col-sm-11">
                                    @Html.DropDownListFor(model => model.Article.CategoryId, (SelectList)ViewBag.Category, "---请选择---", new { @class = "select2 required" })
                                </div>
                            </div>
                        }
                        @if (Model.IsShowElement(ArticleElement.Title))
                        {
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right">@Html.LabelFor(model => model.Article.Title)</label>
                                <div class="col-sm-11">
                                    @Html.TextBoxFor(model => model.Article.Title, new { @class = "form-control input-sm" })
                                    @Html.ValidationMessageFor(model => model.Article.Title)
                                </div>
                            </div>
                        }

                        <div class="form-group">
                            <label for="dtp_input2" class="col-sm-1 control-label no-padding-right">日期</label>
                            <div class="input-group date form_date col-md-5" data-date="" data-date-format="dd MM yyyy" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
                                <input class="form-control" size="16" type="text" value="@Model.Article.CreateDate" readonly>
                                <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                                <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                            </div>

                            @Html.TextBoxFor(model => model.Article.CreateDate, new
                           {
                               @class = "form-control input-sm",
                               @type = "hidden",
                               @id = "dtp_input2"

                           })

                        </div>



                        @if (Model.IsShowElement(ArticleElement.FileName))
                        {
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right">@Html.LabelFor(model => model.Article.FileName) </label>
                                <div class="col-sm-11">
                                    <div id="swfu_container" style="margin: 3px 10px;">
                                        <div>
                                            <span id="spanButtonPlaceholder"></span>
                                        </div>
                                    </div>
                                    <div id="thumbnails">
                                        @Html.Raw(ViewBag.Picture)
                                    </div>
                                </div>
                            </div>
                        }
                        @if (Model.IsShowElement(ArticleElement.LinkUrl))
                        {
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right">@Html.LabelFor(model => model.Article.LinkUrl)  </label>
                                <div class="col-sm-11">
                                    @Html.TextBoxFor(model => model.Article.LinkUrl, new { @class = "form-control input-sm" })
                                </div>
                            </div>
                        }

                        @if (Model.IsShowElement(ArticleElement.Summary))
                        {
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right">@Html.LabelFor(model => model.Article.Summary)</label>
                                <div class="col-sm-11">
                                    @Html.TextAreaFor(model => model.Article.Summary,5,50, new { @class = "form-control input-sm" })
                                    <label style="display: none">不填将自动截取内容255个字符</label>
                                </div>
                            </div>
                        }
                        <div class="form-group" @if (!Model.IsShowElement(ArticleElement.Content)) { @Html.Raw("style = 'display:none;'")              }>
                            <label class="col-sm-1 control-label no-padding-right"> @Html.LabelFor(model => model.Article.Content) </label>

                            <div class="col-sm-11">
                                <script type="text/plain" id="UEContent" name="Article.Content">
                                    @Html.Raw(ViewBag.Count)
                                </script>
                            </div>
                        </div>
                    </div>

                    <div id="extend" class="tab-pane">

                        @if (Model.IsShowElement(ArticleElement.Source))
                        {

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right">@Html.LabelFor(model => model.Article.Source) </label>
                                <div class="col-sm-11">
                                    @Html.TextBoxFor(model => model.Article.Source, new { @class = "form-control input-sm" })
                                </div>
                            </div>
                        }


                        @if (Model.IsShowElement(ArticleElement.Author))
                        {
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right">@Html.LabelFor(model => model.Article.Author)</label>
                                <div class="col-sm-11">
                                    @Html.TextBoxFor(model => model.Article.Author, new { @class = "form-control input-sm" })
                                </div>
                            </div>
                        }
                    </div>

                    <div id="seo" class="tab-pane">
                        @if (Model.IsShowElement(ArticleElement.SeoTitle))
                        {
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right">@Html.LabelFor(model => model.Article.SeoTitle)</label>
                                <div class="col-sm-11">
                                    @Html.TextBoxFor(model => model.Article.SeoTitle, new { @class = "form-control input-sm" })
                                    255个字符以内
                                    @Html.ValidationMessageFor(model => model.Article.SeoTitle)
                                </div>
                            </div>
                        }
                        @if (Model.IsShowElement(ArticleElement.SeoKeywords))
                        {
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right">@Html.LabelFor(model => model.Article.SeoKeywords)</label>
                                <div class="col-sm-11">
                                    @Html.TextAreaFor(model => model.Article.SeoKeywords, new { @class = "form-control input-sm" })
                                    以“,”逗号区分开，255个字符以内
                                    @Html.ValidationMessageFor(model => model.Article.SeoKeywords)
                                </div>
                            </div>
                        }
                        @if (Model.IsShowElement(ArticleElement.SeoDescription))
                        {
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right">@Html.LabelFor(model => model.Article.SeoDescription)</label>
                                <div class="col-sm-11">
                                    @Html.TextAreaFor(model => model.Article.SeoDescription, new { @class = "form-control input-sm" })
                                    255个字符以内
                                    @Html.ValidationMessageFor(model => model.Article.SeoDescription)
                                </div>
                            </div>
                        }


                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label no-padding-right">@Html.ValidationSummary(true)</label>
                        <div class="col-sm-11">
                            <input type="hidden" id="mid" value="@Request.RequestContext.RouteData.Values["mid"]" />
                            <input type="hidden" id="cid" value="@Request.RequestContext.RouteData.Values["cid"]" />
                            @Html.HiddenFor(model => model.Article.ID)
                            <input type="submit" name="btnSubmit" value="保存" id="btnSave" class="btn btn-info" />
                            &nbsp;&nbsp;&nbsp;&nbsp;<input name="重置" type="reset" class="btn btn-danger" value="重 置" />
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

@section Script {
    <script src="@Url.Content("~/Resource/UEditor/editor_config.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Resource/UEditor/_examples/editor_api.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui.custom.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/bootstrap-colorpicker.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/bootstrap-datepicker.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/locales/bootstrap-datetimepicker.zh-CN.js")" type="text/javascript"></script>

    <script src="@Url.Content("~/Resource/UEditor/third-party/swfupload/swfupload.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Admin/swfupload.handlers.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.form.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Admin/VipSoft.CMS.Article.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $('.form_date').datetimepicker({

            weekStart: 1,
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            minView: 2,
            forceParse: 0
        });
    </script>
}


